package org.jeecg.modules.wmhb.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.jeecg.modules.wmhb.entity.WmSkillChange;
import org.jeecg.modules.wmhb.entity.WmTaskbook;
import org.jeecg.modules.wmhb.mapper.WmSkillChangeMapper;
import org.jeecg.modules.wmhb.service.IWmSkillChangeService;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * @Description: 技改单
 * @Author: jeecg-boot
 * @Date:   2024-08-31
 * @Version: V1.0
 */
@Service
public class WmSkillChangeServiceImpl extends ServiceImpl<WmSkillChangeMapper, WmSkillChange> implements IWmSkillChangeService {
    @Override
    public WmSkillChange queryLatestRow(String WmTaskbookId){
        LambdaQueryWrapper<WmSkillChange> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(WmSkillChange::getWmTaskbookId, WmTaskbookId).orderByDesc(WmSkillChange::getCreateTime).last("LIMIT 1");
        WmSkillChange wmSkillChange = getOne(queryWrapper);
        return wmSkillChange;
    };
}
